import os
import re
import sys

if __name__=='__main__':
    orig=open(sys.argv[1],'r')
    new=open(sys.argv[2],'r')
    num_lines=0
    culmulative_error=0
    for orig_line in orig.readlines():
        predicted_result=float(new.readline().strip('\r\n'))
        actual_result=float(orig_line.partition(' ')[0])
        cur_error=abs(predicted_result-actual_result)
        culmulative_error=culmulative_error+cur_error
        num_lines=num_lines+1
    error=culmulative_error/num_lines
    print error
